package com.avic.map.common.util.lang;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class BaseResponse {

    private static final String SUCCESS_CODE = "000000";

    @ApiModelProperty("请求是否成功")
    private boolean success = false;

    @ApiModelProperty("请求状态码 000000为请求成功")
    private String code;

    @ApiModelProperty("请求响应描述信息")
    private String message;

    /**
     * Sets success.
     *
     * @param success the success
     */
    public void setSuccess(boolean success) {
        this.success = success;
        if (success) {
            this.code = SUCCESS_CODE;
            this.message = "请求成功";
        }
    }
}
